#pragma once
#include "graph.h"


int main() {
	//to test
	Graph< Node< long long >, double > gr;
	Node< long long > fir( 7 );
	Node< long long > sec( 8 );
	Node< long long > third( 9 );
	vector< pair< long long, double > > vec3;
	vector< pair< long long, double > > vec1;
	vec1.push_back( make_pair( 1, 2 ) );
	printf( "%f \n", vec1[0].second );
	vector< pair< long long, double > > vec2;
	vec2.push_back( make_pair( 2, 4 ) );
	vec1.push_back( make_pair( 2, 3 ) );
	printf( "%f \n", vec1[0].second );
	gr.AddVertex( fir, vec1 );
	printf( "%f \n", ( *gr.GetGraph() )[0][0].second );
	gr.AddVertex( sec, vec2 );
	gr.AddVertex( third, vec3 );
	CEveryNodeIterator< Node< long long > > it = gr.TakeEveryNode();
	CEveryEdgeIterator< double > ited = gr.TakeEveryEdge();
	CAdjacentIterator< double > itad = gr.GetAdjacent( 0 );
	CWidthIterator< Node< long long > > itdef = gr.GetBfs().GetWidthIterator();
	CDepthIterator< Node< long long > > itw = gr.GetDfs().GetDepthIterator();
	Node< long long > nd = itdef.Current();
	printf( "%d WIDTH\n", nd.GetValue() ); 
	printf( "%f \n", ( *gr.GetGraph() )[0][0].second );
	printf( "%d and %d and %f and %f\n", ited.Current().first, ited.Current().second.first, ited.Current().second.second, ( *gr.GetGraph() )[0][0].second );
	printf( "%f\n", ited.Next().second.second );
	printf( "%f and adg %f\n", ited.Next().second.second, itad.Current().first );
	printf( "%f \n", ( *gr.GetGraph() )[0][0].second );
	try {
		it.Next();
	}
	catch( COutofRange& ff ) {
		printf( "%s", ff.GetDescription() );
	}
	vector< vector< pair < long long, double > > >* ss = gr.GetGraph();
	for( unsigned long long i = 0; i < ss->size(); ++ i ) {
		for( unsigned long long j = 0; j < ( *ss )[i].size(); ++j ) 
			cout << ( *ss )[i][j].first << " " << ( *ss )[i][j].second << endl;
	}
	Deikstra< CStandartFunction< Node< long long > >, Node< long long > > bbbd;
	bbbd.DoWithGraph( gr.GetGraph(), gr.GetNodesLs(), 0 );
	gr.GetNodesLs();
	vector< long long > k = bbbd.GetPath( 1 );
	vector< long long > ugga = bbbd.GetPath( 2 );
	vector< double > m = bbbd.GetLength();
	cout << m[1] << endl;
	cout << m[2] << endl;
	for( unsigned long long i = 0; i < k.size(); ++i ) 
		cout << k[i] << " ";
	for( unsigned long long i = 0; i < ugga.size(); ++i )
		cout << ugga[i] << " ";
	return 0;
}